<template>
  <div class="mytechnic">
    <van-cell :border="false">
      <div class="article">
        <div class="content">
          <div class="title">
            {{ item.title }}
          </div>
          <div class="meta">
            <div class="time">{{ item.updated_at | timeFormat }}</div>
            <div class="read">
              <van-icon name="eye-o" /> <span>{{ item.read }}</span>
            </div>
            <div class="star">
              <van-icon name="good-job-o" />
              <span>{{ item.star }}</span>
            </div>
          </div>
        </div>
        <!-- baseUrl + item.cover -->
        <img
          :src="item.cover === null ? imgRul : baseUrl + item.cover"
          alt=""
          class="imgPic"
        />
      </div>
    </van-cell>
  </div>
</template>

<script>
export default {
  props: ['item'],
  data () {
    return {
      baseUrl: process.env.VUE_APP_URL,
      imgRul:
        'https://www.bloglab.cn/wp-content/uploads/thumb/2020/09/fill_w212_h159_g0_mark_1fdb0267558065_1_post.png'
    }
  }
}
</script>

<style lang="less" scoped>
.mytechnic {
  font-size: 12px;
  .article {
    display: flex;
    align-items: center;
    .content {
      flex: 1;
      color: #b4b4bd;
      .title {
        font-size: 16px;
        font-family: PingFangSC, PingFangSC-Medium;
        font-weight: 500;
        color: #181a39;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box; //作为弹性伸缩盒子模型显示。
        -webkit-box-orient: vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
        -webkit-line-clamp: 2; //显示的行
      }
      .meta {
        display: flex;
        align-items: center;
        margin-top: 15px;
        span {
          margin-left: 5px;
        }
        .time {
          flex: 1;
        }
        .read {
          margin-right: 20px;
        }
        .time,
        .read,
        .star {
          display: flex;
          align-items: center;
        }
      }
    }

    .imgPic {
      margin-left: 15px;
      width: 226/2px;
      height: 150/2px;
      border-radius: 6px;
    }
  }
}
</style>
